
from osgeo import ogr, osr
okay_drivers = {'postgis': 'PostgreSQL', 'esri shapefile': 'ESRI Shapefile',
                    'postgresql': 'PostgreSQL', 'shapefile': 'ESRI Shapefile',
                    'geojson': 'GeoJSON', 'spatialite': 'SQLite', 'oracle': 'OCI', 'mysql': 'MySQL'}
driver_name = 'GeoJSON'

driver = ogr.GetDriverByName(str(driver_name))
datasource = driver.Open(r"Alloffset.json")
print(datasource)